package com.ld.security.common.mybatis.constant;

import com.ld.security.common.mybatis.base.constant.SuperConstant;

/**
 * 运算符
 */
public enum SqlCondition implements SuperConstant.SuperEnum {
    anon(""),
    // 等于
    eq("="),
    // 不等
    ne("!="),
    // 模糊
    like("like"),
    // 左模糊
    like_left("like"),
    //右模糊
    like_right("like"),
    //多次模糊查询
    like_many("like"),
    // 属于
    in("in",true),
    // 不属于
    not_in("not in",true),
    // 大于等于
    ge(">="),
    // 大于
    gt(">"),
    // 小于等于
    le("<="),
    // 小于
    lt("<"),
    //范围
    between("",true),
    ;

    private final String value;

    private final  boolean many;

    SqlCondition(String value) {
        this.value = value;
        this.many = false;
    }

    SqlCondition(String value,boolean many) {
        this.value = value;
        this.many = many;
    }

    public boolean isMany() {
        return many;
    }

    @Override
    public String getLabel() {
        return this.value;
    }

    public String getValue() {
        return this.name();
    }
}
